package priv.abadstring.study.service;

import com.alibaba.dubbo.config.annotation.Service;
import priv.abadstring.study.pojo.User;

import java.util.ArrayList;
import java.util.List;

/**
 * com.alibaba.dubbo.config.annotation.Service: 声明这是一个 dubbo 服务
 * version: 指明服务的版本号
 *
 * @author aBadString
 * @date 2021-06-14 19:04:04
 */
@Service(version = "${dubbo.service.version}")
public class UserServiceImpl implements UserService{
    @Override
    public List<User> queryAll() {
        List<User> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            User user = new User();
            user.setAge(10 + i);
            user.setId((long) (i + 1));
            user.setPassword("123456");
            user.setUsername("username_" + i);
            list.add(user);
        }
        return list;
    }
}
